<%@page contentType="text/html;charset=utf-8" pageEncoding="utf-8" %>
<jsp:include page="head.jsp"></jsp:include>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>控制台</title>
    <link rel="stylesheet" type="text/css" href="../../statics/css/identify.css" />
    <link rel="stylesheet" type="text/css" href="../../statics/css/layout.css" />
    <link rel="stylesheet" type="text/css" href="../../statics/css/style.css" />
    <link rel="stylesheet" type="text/css" href="../../statics/css/control_index.css" />
    <script type="text/javascript" src="../../statics/js/jquery-1.7.2.min.js"></script>
    <script type="text/javascript" src="../../statics/js/layer.js"></script>
    <script type="text/javascript" src="../../statics/js/haidao.offcial.general.js"></script>
    <script type="text/javascript" src="../../statics/js/select.js"></script>
    <script type="text/javascript" src="../../statics/js/haidao.validate.js"></script>
</head>

<style>
    a{
        color:#666; font-size:14px;
    }

</style>
<body>


<div class="view-body">
    <div class="view-product">
        <div class="info-center">
            <div class="manage-head">
                <h6 class=" padding-left manage-head-con ">业主新增</h6>
            </div>

            <div class="basic-info-detail clearfix">
                <div class="unit-style padding-big-lr clearfix">
                    <h4 class="real-name-head margin-large-top">业主信息<span class="margin-left <text-normal></text-normal>">请填写业主基本信息</span></h4>
                    <form id="xzform">
                    <div class="real-name-con margin-top-25 clearfix">
                        <p class="content-left-zoon margin-small-top">
                            性   别
                        </p>
                        <div class="content-right-zoon margin-top-15">
                            <label class="no-time"><span class="fl">
										<input class="licence-class" type="radio" name="owner_sex" checked="checked" data-hide="normal_licence" data-show="various_licence" value="0">
										</span><em class="fl">男</em></label>
                            <label class="no-time"><span class="fl">
										<input class="licence-class1 margin-large-left" type="radio" name="owner_sex" data-hide="various_licence" data-show="normal_licence" value="1">
										</span><em class="fl">女</em></label>
                        </div>
                    </div>
                    <div class="real-name-con height-main margin-top-25 clearfix">
                        <p class="content-left-zoon">
                            业主姓名
                        </p>
                        <div class="content-right-zoon">
                            <input class="width-main input" type="text" datatype="*" name="owner_name" value="" required="required">
                        </div>
                    </div>


                    <div class="real-name-con margin-top-25 clearfix">
                        <p class="content-left-zoon">
                            身份证号码
                        </p>
                        <div class="content-right-zoon">
                            <input class="width-main input" type="text" datatype="*" name="owner_zjhm" value="" required="required">
                        </div>
                    </div>
                    <div class="real-name-con margin-top-25 clearfix">
                        <p class="content-left-zoon">
                            家庭住址
                        </p>
                        <div class="content-right-zoon">
                            <input class="width-main input" type="text" datatype="*" name="owner_address" value="" required="required">
                        </div>
                    </div>
                    <div class="real-name-con height-main margin-top-25">
                        <p class="content-left-zoon">
                            联系方式
                        </p>
                        <div class="content-right-zoon">
                            <input class="width-main input" type="text" datatype="*" name="owner_phone" value="" required="required">
                        </div>
                    </div>
                    </form>
                    <div class="real-name-con margin-top-25">
                        <div class="margin-large-top padding-left text-left content-right-zoon">
                            <input type="button" value="新 增" class="submit fl" id = "insertowner" style="margin-left: 80px" >
                        </div>
                    </div>
                </div>
            </div>
        <div class="show-page padding-top-0 layout hidden">
            <ul class="tr-float">
            </ul>
        </div>
    </div>
</div>

<script>
    $("#insertowner").click(function () {
        $.ajax({
            type: "POST",
            url: "http://localhost:8888/manage/insertOwner",
            data: $('#xzform').serialize(),// 你的formid
            async: false,
            success: function (data) {
                if(data.success == true && data.error == 0){
                    $(".width-main input").val('');
                    alert("新增业主成功！");
                }else if(data.repeat == 1){
                    alert("该业主已经存在 请重填字段!");
                }else if(data.error !=0 ){
                    var message = data.error;
                    alert(message);
                }

            }
        });
    });

</script>
</body>

</html>